import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入第一个数：");
        double num1 = scanner.nextDouble();

        System.out.print("请输入第二个数：");
        double num2 = scanner.nextDouble();

        System.out.print("请选择运算符（+、-、*、/）：");
        char operator = scanner.next().charAt(0);

        double result = 0;
        switch (operator) {
            case '+':
                result = num1 + num2;
                break;
            case '-':
                result = num1 - num2;
                break;
            case '*':
                result = num1 * num2;
                break;
            case '/':
                result = num1 / num2;
                break;
            default:
                System.out.println("无效的运算符！");
                return;
        }

        System.out.println("结果：" + num1 + " " + operator + " " + num2 + " = " + result);

        scanner.close();
    }
}